#pragma once

#include <stdio.h>
#include <stdlib.h>

typedef int BOOL;
#define TRUE 1
#define FALSE 0

#define OVERFLOW -2
#define INFEASIBLE -1
#define ERROE 0

#define LIST_INIT_SIZE 100
#define LISTINCREMENT 10

#define ElemType int

typedef struct {
    ElemType* elem;
    int length;
    int listsize;
} SqList, *pSqList;

void TestSqList();

void showElem(ElemType);

BOOL InitList(pSqList);

void DestroyList(pSqList);

void ClearList(pSqList);

BOOL IsEmpty(SqList);

int GetLength(SqList);

BOOL GetElem(pSqList, int, ElemType*);

BOOL InsertElem(pSqList, int, ElemType);

BOOL AppendElem(pSqList, ElemType);

BOOL DeleteElem(pSqList, int);

void TraveseList(pSqList, void (*)(ElemType));